
// IMPORTS
import MASS.*;                  // MASS Library
import java.util.AbstractMap.*; // for simple key-value pairs


public class MassNine extends Place {
        private static final int init_ = 0;           // initialize Places
        private static final int dummy_ = 1;
        private static final int receive_ = 2;
        int[] bInts;
        int[] cInts;
        
        public MassNine(Object interval) {
            
        }
        
    public Object callMethod(int funcId, Object args) {
        switch (funcId) {
            case init_:
                return init(args);
            case dummy_:
                return dummy(args);
            case receive_:
                return receive(args);

        }
        return null;
    }
    public Object init(Object args) {
        bInts = new int[4];
        cInts = new int[9];
        
        System.err.println("MASS Nine init: Nine called: " + index[0]);
        return null;

    }
    
    public Object dummy(Object args) {
        System.err.println("MASS Nine func 1 dummy: In dummy function");
        return null;
        
    }
    public Object receive(Object args) {

        if (inMessages != null) {
            cInts = (int[])inMessages[0];
        
//            if(cInts == null) {
//                System.err.println("cInts is null for node: " + index[0]);
//            }

//        cInts = (int[])inMessages[0];
//        System.err.println("Node: " + index[0] + ", cInts Length: " + cInts.length);
            System.err.println("MASS Nine func 2 receive --> Node: " + index[0] + " received data");
           
        }
        else {
            System.err.println("MASS Nine func 2 receive --> Node: " + index[0] + " is null");
        }
        return null;
    }
}
